Skip to content

Conversation

@anotherjesse
Copy link
Contributor

@anotherjesse anotherjesse commented Aug 1, 2025

you must either specify the jsonschemas or enable (deprecated) proxy mode

handler<E,T>(fn) types say that the state should be of type T, but if the user specifies T has a Cell<...> it will be stripped away by the compiler - and so our runtime won't know - and it was enabling proxy mode

we should only enable proxy mode if the user explicitly specifies.


Summary by cubic

Updated the handler function to require either explicit JSON schemas or proxy mode to prevent invalid handler types from being accepted.

  • Bug Fixes
    • Throws an error if no schema is provided and proxy mode is not enabled.
    • Only enables proxy mode when explicitly specified.

you must either specify the jsonschemas or enable (deprecated) proxy mode

handler<E,T>(fn) types say that the state should be of type T, but if
the user specifies T has a Cell<...> it will be stripped away by the
compiler - and so our runtime won't know - and it was enabling proxy mode

we should only enable proxy mode if the user explicitly specifies.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

No issues found across 2 files. Review in cubic

Copy link
Contributor

@ubik2 ubik2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ellyxir
Copy link
Contributor

ellyxir commented Aug 1, 2025

@anotherjesse all ready to merge?

@anotherjesse anotherjesse merged commit 2b7fa35 into main Aug 4, 2025
7 checks passed
@anotherjesse anotherjesse deleted the remove-footgun branch August 4, 2025 13:55
jakedahn added a commit that referenced this pull request Aug 4, 2025
jakedahn added a commit that referenced this pull request Aug 4, 2025
jakedahn added a commit that referenced this pull request Aug 5, 2025
jakedahn added a commit that referenced this pull request Aug 5, 2025
#1575)

* adding explicit proxy:true, to fix default charm list in new CTS check

* Revert "Revert "without CTS, our types allow invalid handler (#1551)" (#1568)"

This reverts commit bc970a5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants